function gs_distro_package
% GS_DISTRO_PACKAGE
% Packages the most recent GalvoScanner build in a zip file for distribution.
%
% Notes:
%  - depends on Linux environment to run
%  - zip file 
%  - include build number in package name
%  - exclude .asv, .mbk and .mat files
%  - exclude .svn directories
%  - exclude ./bin/src directory

sBuild = gs_get_build_number;
sArchName = ['galvoscanner_build_' sBuild '.zip'];

sPath = which('galvoscanner');
sPath = sPath(1:end-27);
cd(sPath)

sCommand = ['zip -rb' sPath ' -n .asv:.mbk:.mat:.svn:.svn-base ' sArchName ' -x \*.svn']

% initial compress without .svn directories
sCmd = ['zip -r ' sArchName ' ./galvoscanner/']
system(sCmd)

% delete .asv files
sCmd = ['zip -d ' sArchName ' \*.asv']
system(sCmd)

% delete .mbk files
sCmd = ['zip -d ' sArchName ' \*.mbk']
system(sCmd)

% delete .svn directories
sCmd = ['zip -d ' sArchName ' \*.svn\*']
system(sCmd)

% delete .m~ files
sCmd = ['zip -d ' sArchName ' \*.m~']
system(sCmd)

